import App from './App'

import store from './store/index.js';

Vue.prototype.$store = store
import share from './common/share.js'
Vue.mixin(share)
// 引入配置文件
import $C from './common/config.js';
Vue.prototype.$C = $C
// 挂在助手函数库
import $U from './common/util.js';
Vue.prototype.$U = $U
// 引入请求库
import $H from './common/request.js';
Vue.prototype.$H = $H
// 权限验证操作
Vue.prototype.checkAuth = (callback, checkPhone = true) => {
	// 权限验证
	if (!store.state.loginStatus) {
		uni.showToast({
			title: '请先登录',
			icon: 'none'
		});
		return uni.navigateTo({
			url: '/pages/my/empower'
		});
	}
	
	callback()
}

// 权限验证跳转
Vue.prototype.navigateTo = (options, checkPhone = true) => {
	// 权限验证
	if (!store.state.loginStatus) {
		uni.showToast({
			title: '请先登录',
			icon: 'none'
		});
		return uni.navigateTo({
			url: '/pages/my/empower'
		});
	}


	uni.navigateTo(options);
}

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif